package com.ntschy.bt.entity.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 *
 * @author lxr
 *
 * 处理结果
 */

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtHelpEnterResultEnum implements IEnum<Integer> {

    /**
     * 处理结果 1已解决 2未解决
     */
    RESOLVED(1, "已解决"),
    UNSOLVED(2,"未解决");



    //    @EnumValue
//    @JsonValue
    private final int value;

    //    @JsonValue
    private final String desc;

    BtHelpEnterResultEnum(int value,String desc){
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }




    @JsonCreator
    public static BtHelpEnterResultEnum BtHelpBackFromValue(Integer value){
        for (BtHelpEnterResultEnum examineResult : BtHelpEnterResultEnum.values()){
            if(examineResult.getValue() == value){
                return examineResult;
            }
        }

        return  null;
    }
}
